package com.zsrt.java.day20161230.wrl.t04;

import java.util.Scanner;

public class ChangManager {
	public static void main(String[] args) {
		Manager manager = new Manager();	//创建管理员
		manager.username = "manager";
		manager.password = "123";
		
		String name;	//新登录名
		String psw;		//新密码
		Scanner sc = new Scanner(System.in);
		System.out.print("请输入旧用户名：");
		name = sc.next();
		System.out.print("请输入旧密码：");
		psw  = sc.next();
		if (name.equals(manager.username)&&psw.equals(manager.password)) {
			System.out.print("\n请输入新用户名：");
			manager.username = sc.next();	//更新用户名
			System.out.print("\n请输入新密码：");
			manager.password = sc.next();	//更新密码
		}else {
			System.out.println("用户名跟密码不匹配，请重新输入！");
		}
		System.out.println("\n"+manager);
		sc.close();
	}

}
